#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
#include"stack.h"
#include"queue.h"
#include"priority_queue.h"
#include"string"
#include"list"

namespace zpl
{
	template<class T>
	class less
	{
	public:
		bool operator()(const T& x, const T& y)
		{
			return x < y;
		}
	};
	template<class T>
	class greater
	{
	public:
		bool operator()(const T& x, const T& y)
		{
			return x > y;
		}
	};
}

int main()
{
	/*zpl::stack<int> st;
	st.push(1);
	st.push(2);
	st.push(3);
	st.push(4);
	while (!st.empty())
	{
		cout << (st.top()+=1) << " ";
		st.pop();
	}
	cout << endl;*/
	/*zpl::queue<int> st;
	st.push(1);
	st.push(2);
	st.push(3);
	st.push(4);
	while (!st.empty())
	{
		cout << (st.front() += 1) << " ";
		st.pop();
	}
	cout << endl;*/
	/*vector<int> v(10, 1);
	zpl::priority_queue<int, vector<int>, greater<int>> q(v.begin(), v.end());
	q.push(1);
	q.push(2);
	q.push(3);
	q.push(4);
	while (!q.empty())
	{
		cout << q.top() << " ";
		q.pop();
	}*/
	/*std::priority_queue<int> a;

	std::priority_queue<int, vector<int>, greater<int> > c;

	std::priority_queue<string> b;

	for (int i = 0; i < 5; i++)

	{

		a.push(i);

		c.push(i);

	}

	while (!a.empty())

	{

		cout << a.top() << ' ';

		a.pop();

	}

	cout << endl;

	while (!c.empty())

	{

		cout << c.top() << ' ';

		c.pop();

	}

	cout << endl;

	b.push("abc");

	b.push("abcd");

	b.push("cbd");

	while (!b.empty())

	{

		cout << b.top() << ' ';

		b.pop();

	}

	cout << endl;*/
	int array[] = { 1, 2, 3, 4, 0, 5, 6, 7, 8, 9 };

	int n = sizeof(array) / sizeof(int);

	list<int> mylist(array, array + n);

	auto it = mylist.begin();

	while (it != mylist.end())

	{

		if (*it != 0)

			cout << *it << " ";

		else

			it = mylist.erase(it);

		++it;

	}
	return 0;
}